<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>回收分析</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
    <style>
        .layui-quote-err {
            border-left: 5px solid #FF5722;
            background-color: #FCF8E3;
        }
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <blockquote class="layui-elem-quote layui-quote-err">
            <span style="color: red;">某日期访问推广链接的用户后续30天的回收</span><br>
            访问用户 = 注册用户 + 其他用户<br>
            其他用户：老用户、新运营读者（其他同级账号变更到你账号下的，可在菜单“读者列表”左上角查看注释）<br>
            其他用户会包含一部分注册用户（概率很小，除非某日期用户从 >=2 条链接进入，并且是该日期注册）<br>
        </blockquote>

        <div lay-filter="listSearch" class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                {neq name="role_name" value="channel"}
                <div class="layui-inline">
                    <select name="channel_id" lay-search>
                        <option value="">请选择投放号</option>
                        {volist name="channels" id="v"}
                        <option value="{$v.id}">{$v.account}</option>
                        {/volist}
                    </select>
                </div>
                {/neq}

                <div class="layui-inline">
                    <input type="text" id="dayStart" name="start_date" placeholder="请输入起始日期" autocomplete="off" class="layui-input">
                </div>

                <div class="layui-inline">
                    <input type="text" id="dayEnd" name="end_date" placeholder="请输入截止日期" autocomplete="off" class="layui-input">
                </div>

                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-list-front-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>

            </div>

        </div>



        <div class="layui-card-body">
            <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
        </div>
    </div>
</div>

<script src="/static/layuiadmin/layui/layui.js"></script>
<script>
    var cols1 = [[
        {field: 'rp_date', width: 150, title: '日期', align:'center',rowspan:2,fixed:'left'}
        ,{field: '', title: '访问用户', align:'center',width:150,colspan:2}
        ,{field: 'cost', title: '总成本', align:'center',width:150,rowspan:2}
        ,{field: 'adu_num', title: '加桌人数', align:'center',width:150,rowspan:2}
        ,{field: 'nu_money', title: '<span>新粉充值 <i class="layui-icon" lay-tips="2024-05-15后开始统计</br>该日“注册用户”，在后续的充值">&#xe60b;</i></span>', align:'center',width:150,rowspan:2}
        ,{field: 'fast_money', title: '<span>累计首充 <i class="layui-icon" lay-tips="2024-05-15后开始统计</br>该日访问用户，在后续第一次充值的和，如果此读者以前成功充值过，就不是首充则不计入">&#xe60b;</i></span>', align:'center',width:150,rowspan:2}
        ,{field: 'money', title: '累计充值', align:'center',width:150,rowspan:2}
        ,{field: 'pu_num', title: '累充人数', align:'center',width:150,rowspan:2}
        ,{field: 'hs_rate', title: '累计回收率', align:'center',width:150,rowspan:2}
        ,{field: '', title: '1日', align:'center',colspan:2}
        ,{field: '', title: '2日', align:'center',colspan:2}
        ,{field: '', title: '3日', align:'center',colspan:2}
        ,{field: '', title: '4日', align:'center',colspan:2}
        ,{field: '', title: '5日', align:'center',colspan:2}
        ,{field: '', title: '6日', align:'center',colspan:2}
        ,{field: '', title: '7日', align:'center',colspan:2}
        ,{field: '', title: '8日', align:'center',colspan:2}
        ,{field: '', title: '9日', align:'center',colspan:2}
        ,{field: '', title: '10日', align:'center',colspan:2}
        ,{field: '', title: '11日', align:'center',colspan:2}
        ,{field: '', title: '12日', align:'center',colspan:2}
        ,{field: '', title: '13日', align:'center',colspan:2}
        ,{field: '', title: '14日', align:'center',colspan:2}
        ,{field: '', title: '15日', align:'center',colspan:2}
        ,{field: '', title: '16日', align:'center',colspan:2}
        ,{field: '', title: '17日', align:'center',colspan:2}
        ,{field: '', title: '18日', align:'center',colspan:2}
        ,{field: '', title: '19日', align:'center',colspan:2}
        ,{field: '', title: '20日', align:'center',colspan:2}
        ,{field: '', title: '21日', align:'center',colspan:2}
        ,{field: '', title: '22日', align:'center',colspan:2}
        ,{field: '', title: '23日', align:'center',colspan:2}
        ,{field: '', title: '24日', align:'center',colspan:2}
        ,{field: '', title: '25日', align:'center',colspan:2}
        ,{field: '', title: '26日', align:'center',colspan:2}
        ,{field: '', title: '27日', align:'center',colspan:2}
        ,{field: '', title: '28日', align:'center',colspan:2}
        ,{field: '', title: '29日', align:'center',colspan:2}
        ,{field: '', title: '30日', align:'center',colspan:2}

    ]
        ,[
            {field: 'nu_num', title: '注册用户', width: 100,align:'center'}
            ,{field: 'cu_num', title: '其他用户', width: 100,align:'center'}


            ,{field: 'rate_recovery_1', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_1', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_2', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_2', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_3', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_3', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_4', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_4', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_5', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_5', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_6', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_6', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_7', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_7', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_8', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_8', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_9', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_9', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_10', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_10', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_11', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_11', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_12', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_12', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_13', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_13', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_14', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_14', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_15', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_15', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_16', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_16', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_17', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_17', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_18', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_18', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_19', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_19', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_20', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_20', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_21', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_21', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_22', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_22', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_23', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_23', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_24', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_24', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_25', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_25', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_26', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_26', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_27', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_27', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_28', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_28', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_29', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_29', title: '充值', width: 120,align:'center'}
            ,{field: 'rate_recovery_30', title: '回收率', width: 100,align:'center'}
            ,{field: 'increase_30', title: '充值', width: 120,align:'center'}
        ]];
</script>
<script>

    layui.use('laydate', function () {
        var $ = layui.$;
        var laydate = layui.laydate;

        var nowTime = new Date().valueOf();
        var start = laydate.render({
            elem: '#dayStart',
            type: 'date',
            max: nowTime,
            done: function (value, date) {
                endMax = end.config.max;
                end.config.min = date;
                end.config.min.month = date.month - 1;
            }
        });
        var end = laydate.render({
            elem: '#dayEnd',
            type: 'date',
            max: nowTime,
            done: function (value, date) {
                if ($.trim(value) == '') {
                    var curDate = new Date();
                    date = {
                        'date': curDate.getDate(),
                        'month': curDate.getMonth() + 1,
                        'year': curDate.getFullYear()
                    };
                }
                start.config.max = date;
                start.config.max.month = date.month - 1;
            }
        });
    });

    layui.config({
        base: '/static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','table','admin'], function(){
        var $ = layui.$
            ,form = layui.form
            ,admin = layui.admin
            ,table = layui.table;


        form.on('submit(LAY-list-front-search)', function(data){
            var field = data.field;
            table.reload('LAY-list-manage', {
                where: field
                ,page: {
                    curr: 1  // 将页码重置为第一页
                }
            });
        });


        table.render({
            elem: '#LAY-list-manage'
            ,url: "{:url('recovery/dataList')}" //模拟接口
            , response: {
                statusCode: 1 //规定成功的状态码，本来是：0，现在统一改为1
            }
            ,totalRow: true
            ,cols: cols1
            ,page: true
            ,limit: 10
            ,limits: [10,20,30,40]
            ,width: '100%'
        });


    });
</script>
</body>
</html>